cmake_minimum_required( VERSION 3.1)
#add_definitions(-fno-rtti)
  
set(CMAKE_BUILD_TYPE Debug)   # 设置编译选项为调试模式

# 启用C++17支持  
set(CMAKE_CXX_STANDARD 17)  
set(CMAKE_CXX_STANDARD_REQUIRED True) 

add_compile_options(-std=c++17)
add_definitions(-std=c++17 -Wno-attributes -Wno-deprecated-declarations -DANDROID_STL=c++_shared)

#--------------------------
# 485 communication
#--------------------------
set(TAIIC_RS_UART_SRC
    rs_485/ts_uart.cpp
)
add_executable(ts_uart ${TAIIC_RS_UART_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(ts_uart ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS ts_uart RUNTIME DESTINATION "bin")

#----------------------------
# uart command id call
#----------------------------
set(TAIIC_RS_UART_TIP_SRC
    rs_485/uart_commid_img.cpp
)
add_executable(uart_commid ${TAIIC_RS_UART_TIP_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(uart_commid ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS uart_commid RUNTIME DESTINATION "bin")

# 音视融合数据采集平台
set(TAIIC_AVI_SAVE_SOC_SRC
    taiic_avi_save/avi_isp_debug_test.cpp
    #taiic_avi_save/viai_save_ptt_socket_isp_debug.cpp
    #taiic_avi_save/aivi_save_ptt_socket_isp_debug.cpp
)
add_executable(soc ${TAIIC_AVI_SAVE_SOC_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(soc ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS soc RUNTIME DESTINATION "bin")

#音视融合数据采集平台v2.0:PC端基于socket发送的数据协议，根据接收的协议类型，发送不同的数据
set(TAIIC_SERVER_SOCKET_SRC_V2
    taiic_avi_save/taiic_server_socket_v2.cpp #演示系统v2.0
)
add_executable(taiic_server_socket_v2 ${TAIIC_SERVER_SOCKET_SRC_V2} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_server_socket_v2 ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_server_socket_v2 RUNTIME DESTINATION "bin")

#音视融合数据采集平台v3.0:数据采集平台与演示系统一体化系统
set(TAIIC_SERVER_SOCKET_SRC_V3
    taiic_avi_save/taiic_server_socket_v3.cpp #演示系统v2.0
)
add_executable(taiic_server_socket_v3 ${TAIIC_SERVER_SOCKET_SRC_V3} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_server_socket_v3 ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_server_socket_v3 RUNTIME DESTINATION "bin")
#------------------------------------------------------------------------
# 演示demo:音视融合数据采集平台
# 视频：48frames（160*160*1.5*48），气导：53280，骨导：53280，result.txt：11 bytes
#-------------------------------------------------------------------------
set(TAIIC_AVI_SAVE_SOC_DEMO_SRC
    taiic_avi_save/aivi_soc_demo.cpp
)
add_executable(soc_demo ${TAIIC_AVI_SAVE_SOC_DEMO_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(soc_demo ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS soc_demo RUNTIME DESTINATION "bin")

set(TAIIC_SOC_VI_SRC
    taiic_avi_save/vi_soc_demo.cpp
)
add_executable(soc_vi ${TAIIC_SOC_VI_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(soc_vi ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS soc_vi RUNTIME DESTINATION "bin")

# taiic asr soc send
set(TAIIC_SOC_ASR_SRC
    taiic_avi_save/soc_asr.cpp
)
add_executable(soc_asr ${TAIIC_SOC_ASR_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(soc_asr ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS soc_asr RUNTIME DESTINATION "bin")



set(TAIIC_AVI_SAVE_SOC_RESULT_SRC
    taiic_avi_save/result_soc_demo.cpp
)
add_executable(soc_result ${TAIIC_AVI_SAVE_SOC_RESULT_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(soc_result ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS soc_result RUNTIME DESTINATION "bin")

# 纯音频的数据采集：气导+骨导
set(TAIIC_AI_SOC_SRC
    taiic_avi_save/ai_soc.cpp
)
add_executable(ai_soc ${TAIIC_AI_SOC_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(ai_soc ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS ai_soc RUNTIME DESTINATION "bin")


set(TAIIC_POWER_HOLD_SRC
    taiic_src/power_hold_taiic.cpp
)
add_executable(power_hold ${TAIIC_POWER_HOLD_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(power_hold ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS power_hold RUNTIME DESTINATION "bin")



set(TAIIC_CAM_V4L2_SRC
    taiic_avi_save/came_v4l2.cpp
)
add_executable(came_v4l2 ${TAIIC_CAM_V4L2_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(came_v4l2 ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS came_v4l2 RUNTIME DESTINATION "bin")


set(TAIIC_LIPS_SAVA_SRC
    taiic_avi_save/lips_save.cpp
)
add_executable(lips_save ${TAIIC_LIPS_SAVA_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(lips_save ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS lips_save RUNTIME DESTINATION "bin")



set(TAIIC_AIQ_SRC
    rk_lr/taiic_aiq_demo.cpp
)
add_executable(taiic_aiq ${TAIIC_AIQ_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_aiq ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_aiq RUNTIME DESTINATION "bin")


set(TAIIC_AIQ_LR_SRC
    rk_lr/taiic_aiq_lr_demo.cpp
)
add_executable(taiic_aiq_lr ${TAIIC_AIQ_LR_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_aiq_lr ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_aiq_lr RUNTIME DESTINATION "bin")

set(TAIIC_YUV_RGB_SRC
    taiic_test/yuvToRgb.cpp
)
add_executable(yuvToRgb ${TAIIC_YUV_RGB_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(yuvToRgb ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS yuvToRgb RUNTIME DESTINATION "bin")

set(TAIIC_AVSR_SRC taiic_model/taiic_avsr_bianli.cpp)
add_executable(taiic_avsr_bianli ${TAIIC_AVSR_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_avsr_bianli ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_avsr_bianli RUNTIME DESTINATION "bin")

set(TAIIC_ASR_SINGLE_TEST_SRC
    taiic_model/taiic_asr_single_test.cpp  # ASR单项输入数据测试
)
add_executable(taiic_asr_single_test ${TAIIC_ASR_SINGLE_TEST_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_asr_single_test ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_asr_single_test RUNTIME DESTINATION "bin")

set(TAIIC_MFCC_SINGLE_EIGEN_SRC
    taiic_model/taiic_mfcc_eigen_test.cpp  # Eigen+FFTW:输入PCM，输出MFCC处理
)
add_executable(taiic_mfcc_eigen ${TAIIC_MFCC_SINGLE_EIGEN_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_mfcc_eigen ${ROCKIT_DEP_COMMON_LIBS} ${TAIIC_FFTW_COMMON_LIBS})
install(TARGETS taiic_mfcc_eigen RUNTIME DESTINATION "bin")


set(TAIIC_YOLO_SRC
    taiic_model/yolo_main.cpp
)
add_executable(taiic_yolo ${TAIIC_YOLO_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_yolo ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_yolo RUNTIME DESTINATION "bin")


set(TAIIC_RGA_CROP_SRC
    test_rga/rga_crop_demo.cpp
)
add_executable(rga_crop_demo ${TAIIC_RGA_CROP_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(rga_crop_demo ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS rga_crop_demo RUNTIME DESTINATION "bin")


set(TAIIC_OPENCV_SRC
    taiic_test/test_opencv.cpp
)
add_executable(opencv_demo ${TAIIC_OPENCV_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(opencv_demo ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS opencv_demo RUNTIME DESTINATION "bin")

# set(TAIIC_MFCC_SRC
#     taiic_test/comput_mfcc_pcm.cpp
# )
# add_executable(mfcc ${TAIIC_MFCC_SRC} ${RK_MPI_TEST_COMMON_SRC})
# target_link_libraries(mfcc ${ROCKIT_DEP_COMMON_LIBS})
# install(TARGETS mfcc RUNTIME DESTINATION "bin")

# vsr_taiic_lm_noptt_diantai
set(TAIIC_LM_VSR_NOPTT_DIANTAI_SRC
    taiic_src/vsr_taiic_lm_noptt_diantai.cpp # 电台控制功能
)
add_executable(vsr_taiic_lm_noptt_diantai ${TAIIC_LM_VSR_NOPTT_DIANTAI_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(vsr_taiic_lm_noptt_diantai ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS vsr_taiic_lm_noptt_diantai RUNTIME DESTINATION "bin")

# vsr_taiic_lm_noptt
set(TAIIC_LM_VSR_NOPTT_SRC
    taiic_src/vsr_taiic_lm_noptt.cpp #(1)常规模式通话不受PTT控制;(2)蓝牙模式下,新增图像SPP上传分包处理;(3)有线特殊模型，通过485发送
    # taiic_src/vsr_taiic_lm_woba_noptt_test_512.cpp 
)
add_executable(vsr_taiic_lm_noptt ${TAIIC_LM_VSR_NOPTT_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(vsr_taiic_lm_noptt ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS vsr_taiic_lm_noptt RUNTIME DESTINATION "bin")


# Auto Test Tools
set(TAIIC_AUTO_TEST_TOOLS_SRC
    taiic_src/vsr_taiic_lm_woba_noptt_testTool.cpp #(1)常规模式通话不受PTT控制;(2)蓝牙模式下,新增图像SPP上传分包处理;(3)有线特殊模型，通过485发送
)
add_executable(AutoTestTools ${TAIIC_AUTO_TEST_TOOLS_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(AutoTestTools ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS AutoTestTools RUNTIME DESTINATION "bin")


# # vsr_taiic_lm_ptt
# set(TAIIC_LM_VSR_PTT_SRC
#     taiic_src/vsr_taiic_lm_woba_ptt.cpp #常规模式通话受PTT控制
# )
# add_executable(vsr_taiic_lm_ptt ${TAIIC_LM_VSR_PTT_SRC} ${RK_MPI_TEST_COMMON_SRC})
# target_link_libraries(vsr_taiic_lm_ptt ${ROCKIT_DEP_COMMON_LIBS})
# install(TARGETS vsr_taiic_lm_ptt RUNTIME DESTINATION "bin")

# avsr_taiic_lm
set(TAIIC_LM_AVSR_SRC
    # taiic_src/avsr_taiic_lm_woba_test_noptt.cpp
    taiic_src/avsr_taiic_lm_noptt.cpp 
)
add_executable(avsr_taiic_lm ${TAIIC_LM_AVSR_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(avsr_taiic_lm ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS avsr_taiic_lm RUNTIME DESTINATION "bin")

# taiic_asr:自研的ASR算法
set(TAIIC_ASR_SRC
    taiic_src/taiic_asr.cpp   
)
add_executable(taiic_asr ${TAIIC_ASR_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_asr ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_asr RUNTIME DESTINATION "bin")

# acoustics_institute_asr
set(ACOUSTICS_INSTITUTE_ASR_SRC
    taiic_src/acoustics_institute_asr.cpp
)
add_executable(acoustics_institute_asr ${ACOUSTICS_INSTITUTE_ASR_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(acoustics_institute_asr ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS acoustics_institute_asr RUNTIME DESTINATION "bin")



set(TAIIC_LM_SRC
    taiic_model/test_lm.cpp
)
add_executable(taiic_lm ${TAIIC_LM_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_lm ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_lm RUNTIME DESTINATION "bin")


set(TAIIC_VSR_SINGLE_SRC
    taiic_model/taiic_vsr_single.cpp  #VSR:单个输入数据的的推理
)
add_executable(taiic_vsr_single ${TAIIC_VSR_SINGLE_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_vsr_single ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_vsr_single RUNTIME DESTINATION "bin")

set(TAIIC_VSR_BIANLI_SRC
    taiic_model/taiic_vsr_bianli.cpp #VSR:遍历推理输入数据
)
add_executable(taiic_vsr_bianli ${TAIIC_VSR_BIANLI_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_vsr_bianli ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_vsr_bianli RUNTIME DESTINATION "bin")

#----------------------------------
#     ASR:遍历推理输入数据
#----------------------------------
set(TAIIC_ASR_BIANLI_SRC
    taiic_model/taiic_asr_bianli.cpp 
)
add_executable(taiic_asr_bianli ${TAIIC_ASR_BIANLI_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_asr_bianli ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_asr_bianli RUNTIME DESTINATION "bin")


set(TAIIC_QUANBAO_PTT_SRC
    taiic_test/taiic_ptt_quanbao.cpp
)
add_executable(taiic_quanbao_ptt ${TAIIC_QUANBAO_PTT_SRC} ${RK_MPI_TEST_COMMON_SRC})
target_link_libraries(taiic_quanbao_ptt ${ROCKIT_DEP_COMMON_LIBS})
install(TARGETS taiic_quanbao_ptt RUNTIME DESTINATION "bin")



